package com.shrcl.engineerprocess.domain.impl;

import com.shrcl.engineerprocess.domain.Certification;
import com.shrcl.engineerprocess.domain.CertificationDAO;
import com.shrcl.engineerprocess.domain.impl.CertificationImpl;
import edu.fudan.mylang.pf.BaseDAOService;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.stereotype.Service;

@Service("com.shrcl.engineerprocess.domain.CertificationDAO")
public class CertificationDAOImpl extends BaseDAOService<Certification> implements CertificationDAO {
  public Certification create(final Procedure1<? super Certification> init) {Certification certification=CertificationImpl.create(getObjectFactory());
    final Procedure1<Certification> _function = new Procedure1<Certification>() {
        public void apply(final Certification it) {
          init.apply(it);
        }
      };
    Certification _doubleArrow = ObjectExtensions.<Certification>operator_doubleArrow(certification, _function);
    return _doubleArrow;
  }
  
  public void delete(final Certification certification) {getObjectFactory().delete(certification);
    
  }
  
  public void setObsoleted(final Certification certification) {
    certification.setIsActive(Boolean.valueOf(false));
  }
}
